<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .container{
      width: 100px;
      height: 100px;
      border: 1px solid pink;
      position: relative;
      overflow: hidden;
      float: left;
      gap: 5px;
    }
    .container::before{
      content: '';
      position: absolute;
      width: inherit;
      height: inherit;
      background-color: red;
      transform-origin: left bottom;
      transform: rotate(90deg);
      transition: all .5s;
    }
    .container:hover::before{
      transform: rotate(0);
    }
  </style>
</head>
<body>
  <div class="container"></div>
  <div class="container"></div>
  <div class="container"></div>
</body>
</html>